//
//  SVProgressHUD+Message.m
//  VET
//
//  Created by Lam BG on 2018/7/2.
//  Copyright © 2018年 YZ. All rights reserved.
//

#import "SVProgressHUD+Message.h"

@implementation SVProgressHUD (Message)

+ (void)load {
    
    [SVProgressHUD setDefaultAnimationType:SVProgressHUDAnimationTypeNative];
    [SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeNone]; //设置HUD背景图层的样式
    [SVProgressHUD setForegroundColor:[UIColor whiteColor]];
    [SVProgressHUD setBackgroundColor:[UIColor blackColor]];
    [SVProgressHUD setBackgroundLayerColor:[UIColor clearColor]];
}

+ (void)yz_showMessage:(NSString *)info {
    
    //[SVProgressHUD showWithStatus:string]; //设置需要显示的文字
    [SVProgressHUD setMaximumDismissTimeInterval:2];
    [SVProgressHUD setMinimumDismissTimeInterval:2];
    [SVProgressHUD showImage:[UIImage imageNamed:@"wrt424erte2342rx"] status:info];
}

+ (void)yz_showError:(NSString *)info {
    
    [SVProgressHUD setMaximumDismissTimeInterval:2];
    [SVProgressHUD setMinimumDismissTimeInterval:2];
    [SVProgressHUD showErrorWithStatus:info];
}

+ (void)yz_showErrorInfo:(NSError*)error{
    NSString *errorCode = [@(error.code) stringValue];
    NSString *message = error.userInfo[NSLocalizedDescriptionKey];
    [SVProgressHUD yz_showError:[NSString stringWithFormat:@"%@(%@)", message, errorCode]];
}

@end
